package sincro.basic;

import java.io.File;
import java.util.List;

import common.PropertiesManager;

import sincro.common.LocalUtil;

public class GeneraPaquete {

	public GeneraPaquete() {
		String impDirPath = PropertiesManager.getProperty("Local", "ImpDirPath");
		LocalUtil.deleteFileRecursive(new File(impDirPath + "Upstream/"));
		LocalUtil.deleteFileRecursive(new File(impDirPath + "Buyer/"));

		List<String> fileList = LocalUtil.readFileList(PropertiesManager.getProperty("Local", "ProjectFilePath"));
		if (fileList != null) {
			for(String path : fileList){
				LocalUtil.copyfile(LocalUtil.getLocalPath(path.substring(path.indexOf("\\") + 1), path.startsWith("Upstream")), impDirPath + path);
			}
		}
	}
}
